import axios from '../utils/axios';

export const getAllTasks = (user_id) => 
    axios.get(`/api/tasks?user_id=${user_id}`);
export const addTask = (packData) => 
    axios.post('/api/tasks',packData);
export const deleteTask = (id) => 
    axios.delete(`/api/tasks/${id}`);
export const updateTask = (text,id) => 
    axios.put(`/api/tasks/${id}`,{text});
export const deleteAllTasks = (user_id) => 
    axios.delete('/api/tasks',{data:{user_id}});

export default {
    getAllTasks,
    addTask,
    deleteTask,
    updateTask,
    deleteAllTasks
}

